<!DOCTYPE html>
<html lang="en">

<head>
  <base href="./">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
  <meta name="description" content="CoreUI - Open Source Bootstrap Admin Template">
  <meta name="author" content="Łukasz Holeczek">
  <meta name="keyword" content="Bootstrap,Admin,Template,Open,Source,jQuery,CSS,HTML,RWD,Dashboard">
  <title>订单详情</title>
  <!-- Icons-->
  <link href="../vendors/@coreui/icons/css/coreui-icons.min.css" rel="stylesheet">
  <link href="../vendors/flag-icon-css/css/flag-icon.min.css" rel="stylesheet">
  <link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
  <link href="../vendors/simple-line-icons/css/simple-line-icons.css" rel="stylesheet">
  <link href="../css/style.css" rel="stylesheet">
  <link href="../vendors/pace-progress/css/pace.min.css" rel="stylesheet">
  <link rel="stylesheet" href="../css/product.css">
  <link rel="stylesheet" href="../css/prolist.css">
</head>
<script type="text/css">

            </script>
<style>
  .div1 {
    background: rgb(38, 202, 231);
    color: rgb(252, 247, 247);
  }
</style>

<body class="app header-fixed sidebar-fixed aside-menu-fixed pace-done sidebar-lg-show">
  <header class="app-header navbar">
    <button class="navbar-toggler sidebar-toggler d-lg-none mr-auto" type="button" data-toggle="sidebar-show">
      <span class="navbar-toggler-icon"></span>
    </button>

    <button class="navbar-toggler sidebar-toggler d-md-down-none" type="button" data-toggle="sidebar-lg-show">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="btn-group" role="group" aria-label="Button group">
      <p class="btn"> 你好，无敌的销售员！</p>
      <a class="btn" href="/api/emp/logout">
        <i class="fa fa-share" aria-hidden="true"></i> &nbsp;退出</a>
    </div>


  </header>
  <div class="app-body">


    <div class="sidebar">
      <nav class="sidebar-nav ps ps--active-y">
        <ul class="nav">
          <br>
          <li class="nav-item nav-dropdown ">
            <a class="nav-link nav-dropdown-toggle" href="#">
              <i class="nav-icon icon-puzzle"></i> 客户信息</a>
            <ul class="nav-dropdown-items">
              <li class="nav-item">
                <a class="nav-link" href="/salesman/salesman_add_user">
                  <i class="fa fa-user-plus" aria-hidden="true"></i>&nbsp;添加客户</a>
              </li>
              <li class="nav-item">
                <a class="nav-link" href="/salesman/salesman_manage_user">
                  <i class="fa fa-eye" aria-hidden="true"></i>&nbsp;查看客户</a>
              </li>
            </ul>
          </li>
          <br><br>
          <li class="nav-item nav-dropdown">
            <a class="nav-link nav-dropdown-toggle" href="#">
              <i class="nav-icon icon-star"></i>商城</a>
            <ul class="nav-dropdown-items">

              <li class="nav-item">
                <a class="nav-link" href="/salesman/salesman_show_goods">
                  <i class="fa fa-shopping-basket" aria-hidden="true"></i>&nbsp;商品展示</a>
              </li>
              <li class="nav-item">
                <a class="nav-link" href="/salesman/salesman_manage_order">
                  <i class="icon-speech"></i>&nbsp;订单管理</a>
              </li>
            </ul>
          </li>
          <br><br>
          <li class="nav-item nav-dropdown">
            <a class="nav-link nav-dropdown-toggle" href="#">
              <i class="nav-icon icon-cursor"></i>个人中心</a>
            <ul class="nav-dropdown-items">
              <li class="nav-item">
                <a class="nav-link" href="/salesman/salesman_security">
                  <i class="icons cui-shield"></i> &nbsp;账号安全</a>
              </li>
              <li class="nav-item">
                <a class="nav-link" href="/salesman/salesman_personal_information">
                  <i class="fa fa-bar-chart" aria-hidden="true"></i> &nbsp;个人信息</a>
              </li>

            </ul>
          </li>

        </ul>
        <div class="ps__rail-x" style="left: 0px; bottom: 0px;">
          <div class="ps__thumb-x" tabindex="0" style="left: 0px; width: 0px;"></div>
        </div>
        <div class="ps__rail-y" style="top: 0px; height: 445px; right: 0px;">
          <div class="ps__thumb-y" tabindex="0" style="top: 0px; height: 297px;"></div>
        </div>
      </nav>
      <button class="sidebar-minimizer brand-minimizer" type="button"></button>
    </div>
    <main class="main">
      <!-- Breadcrumb-->
      <ol class="breadcrumb">
        <li class="breadcrumb-item">你的位置：商城->订单管理->订单详情</li>

        <!-- Breadcrumb Menu-->
        <li class="breadcrumb-menu d-md-down-none">

        </li>
      </ol>
      <div id="itemsTemplate">
        <div align="center">
          <div class="card-columns cols-2" style="width:95%;" >

            <div class="card" >
              <div class="card-header">订单信息</div>
              <div class="card-body" >
                <div class="chart-wrapper">

                  <div class="form-group row">
                    <label class="col-md-3 col-form-label" >客户姓名:</label>
                    <div class="col-md-6">
                      <p class="col-form-label">{{items.userInfo.userName}}</p>
                    </div>
                  </div>
                  <div class="form-group row">
                    <label class="col-md-3 col-form-label" >联系电话:</label>
                    <div class="col-md-6">
                      <p class="col-form-label">{{items.userInfo.userTel}}</p>
                    </div>
                  </div>
                  <div class="form-group row">
                    <label class="col-md-3 col-form-label">地址:</label>
                    <div class="col-md-6">
                      <p class="col-form-label">{{items.userInfo.userAddress}}</p>
                    </div>
                  </div>
                  <div class="form-group row">
                    <label class="col-md-3 col-form-label" >订单编号:</label>
                    <div class="col-md-6">
                      <p class="col-form-label">{{items.orderId}}</p>
                    </div>
                  </div>
                  <div class="form-group row">
                    <label class="col-md-3 col-form-label">销售员:</label>
                    <div class="col-md-6">
                      <p class="col-form-label">{{items.empName}}</p>
                    </div>
                  </div>
                </div>
              </div>
            
            </div>

            <div class="card" >

              <div id="collapseExample">
                <table class="table table-hover">
                  <thead class="card-header">
                    <tr>
                      <th class="text-center" scope="col">商品图片</th>
                      <th class="text-center" scope="col">商品名字</th>
                      <th class="text-center" scope="col">单价</th>
                      <th class="text-center" scope="col">数量</th>
                      <th class="text-center" scope="col">折扣</th>
                      <th class="text-center" scope="col">小计</th>
                      <th class="text-center" scope="col">状态</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr class="protop" v-for="(item, index) in items.goodsInfoVOList">
                      <td class="text-center proitem"  style="font-size:17px"><img v-bind:src="item.goodsCoverImg" width="30" height="30" id="proImg">
                      </td>
                      <td class="text-center proitem"  style="font-size:17px">{{item.goodsName}}</td>
                      <td class="text-center proitem"  style="font-size:17px">{{item.goodsSellingPrice}} 元</td>
                      <td class="text-center proitem"  style="font-size:17px">
                        {{item.goodsNum}}
                      </td>
                      <td class="text-center proitem"  style="font-size:17px"><del>{{item.goodsSellingPrice * item.goodsNum - item.goodsPrice}}</del>元</td>
                      <td class="text-center proitem" style="color:#ff6700">{{item.goodsPrice}}元</td>
                      <td class="text-center proitem">
                        <span class="badge badge-secondary"  style="font-size:17px" v-if="item.status === 0">未审批</span>
                        <span class="badge badge-warning"  style="font-size:17px" v-if="item.status === 1 || item.status === 2">正在审批中</span>
                        <span class="badge badge-info"  style="font-size:17px" v-if="item.status === 3">审批完成</span>
                        <span class="badge badge-primary"  style="font-size:17px" v-if="item.status === 4">已发货</span>
                        <span class="badge badge-success"  style="font-size:17px" v-if="item.status === 5">已到货</span>
                      </td>
                    </tr>

                  </tbody>
                </table>
                <div class="card-footer">

                  <div align="right">
                    <span>合计：{{items.allPrice}}元 | 折扣后：{{items.takeInPrice}}元 </span>
                  </div>

                </div>
              </div>
            </div>

          </div>
    </main>
  </div>

  <script src="../vendors/jquery/js/jquery.min.js"></script>
  <script src="../vendors/popper.js/js/popper.min.js"></script>
  <script src="../vendors/bootstrap/js/bootstrap.min.js"></script>
  <script src="../vendors/pace-progress/js/pace.min.js"></script>
  <script src="../vendors/perfect-scrollbar/js/perfect-scrollbar.min.js"></script>
  <script src="../vendors/@coreui/coreui/js/coreui.min.js"></script>
  <script src="../vendors/@coreui/coreui-plugin-chartjs-custom-tooltips/js/custom-tooltips.min.js"></script>
  <script src="../vendors/mock.js/js/mock.min.js"></script>
  <script src="../vendors/vue.js/js/vue.min.js"></script>
  <script type="text/javascript">
    function getParams(key) {
      var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
      var r = window.location.search.substr(1).match(reg);
      if (r != null) {
        return unescape(r[2]);
      }
      return null;
    };
    console.log("参数param1:"+getParams("order_id"));//输出aa
  </script>
  <script>
    var p, d, j;
    var app;
    var items;
    $(function () {
      Mock.mock("http://127.0.0.1:5500/users", {
        "data|1-1": [{
          id: "@increment()",//编号
          goodsId: "@increment()",//商品编号
          "goodsName|1": ["@cname", "@name"],//商品姓名
          goodsSellingPrice: 1000,//商品零售价
          goodsNum: 1,
          goodsCoverImg: "@cname()",//商品图片
          allPrice: 1000,
          takeInPrice: 1000,
          takeInPrice:1000,
          status: 0,
          empName:111111,
          onetakeIn:1000,
          userAddress:11111111111
        }],
        suceess: true,
        code: 200,
        msg: "Success"
      });
      $.getJSON("/orders/findByOrderId/"+getParams("order_id"), function (response) {
        items = response.data;

        console.log(response.data)
        page = Math.ceil(items.length / 5);
        var pageitem = [];
        for (var i = 0; i < page; i++) {
          pageitem[i] = i + 1;
        }
        app = new Vue({
          el: '#itemsTemplate',
          data: {
            items: items,
            checkall: false,
            pagesum: page,//总页码
            pageindex: 1,//当前页码
            pagesize: 5, //页面数据个数
            pageitem: pageitem,
            editIndex: -1,
            edititems: { name: null },
            allPrice: 0,
            userVipCount: 1,
            takeInPrice: ""//实际价格
          },
          computed: {
            pageItems: function () {
              var startIndex = (this.pageindex - 1) * this.pagesize;
              var editIndex = startIndex + this.pagesize - 1;
              return this.items.filter(function (value, index) {
                return (
                  index >= startIndex &&
                  index <= editIndex
                );
              });
            },
          },
          methods: {


          }

        });
        return;
      });
    });
  </script>
</body>

</html>